import pygame, sys
from pygame.locals import *
from Gregor import Gregor

pygame.init()
background_sky = pygame.image.load('Background/sky.png')
pygame.display.set_caption('rocket')
screen = pygame.display.set_mode((1200, 500),0,32)
gregor = Gregor(screen, 50,200)
x = 0
y = 0


while True:
    screen.blit(background_sky,(x,y))
    gregor.show()
    
    keys = pygame.key.get_pressed()
    
    for evento in pygame.event.get():
        if evento.type == QUIT or  keys[K_ESCAPE]:
           pygame.quit()
           sys.exit()
    if keys[K_RIGHT]:
        gregor.move(6, 0)
        pygame.display.update()
    if keys[K_LEFT]:
        gregor.move(-6, 0)
        pygame.display.update()
    if keys[K_UP]:
        gregor.move(0, -6)
    if keys[K_DOWN]:
        gregor.move(0, 6)


    
   
    pygame.display.flip()
    
